previous page main page next page

The Conversion Program

Scroll bars are useful controls and allow the user to enter information which can be used by the program. We're going to develop a program such that the user can specify a distance in miles which the program converts into kilometers. OK, it doesn't sound like it's going to win awards, but bear with us because it does bring out some important ideas...

The form is going to look like this:
 


 

  • build the form according to this specification:
     
  Form Name
Caption
Height
Left
Top
Width
frmConversion
Conversion
4000
2500
1600
6000
 
  Command Button Name
Caption
Height
Left
Top
Width
cmdExit
Exit
495
4320
1560
1215
 
  Text Box Name
Alignment
Height
Left
MultiLine
Top
Width
txtMiles
Center
375
2160
True
960
1695
 
  Text Box Name
Alignment
Height
Left
MultiLine
Top
Width
txtKilometers
Center
375
2160
True
2280
1695
 
  Label Name
Caption
Height
Left
Top
Width
lblMiles
Miles:
375
960
960
1215
 
  Label Name
Caption
Height
Left
Top
Width
lblKilometers
Miles:
375
960
2280
1215
 
  Horizontal Scroll Bar Name
Height
LargeChange
Left
Max
Top
Width
lblMiles
255
5
960
100
1680
2895
 
 

The last control - the horizontal scroll bar - is the sixth down in the left hand column of the toolbox in our illustration. Note the convention of giving it a name starting with hsb.
 

Continued...
 

previous page main page next page ©  ePublish Scotland  1999